//
//  Extension+UIImageView.swift
//  SHWeibo3
//
//  Created by teacher on 16/7/20.
//  Copyright © 2016年 teacher. All rights reserved.
//

import UIKit
import SDWebImage
extension UIImageView {
    // 实例化imageView快捷方法
    convenience init(imgName: String) {
        self.init(image: UIImage(named: imgName))
    }
    func demo(){
        //img.sd_setImageWithURL(NSURL!, placeholderImage: UIImage!)
    }
    // 对SDWebImage 封装
    func sh_setImage(urlString: String?, placeholderImgName: String){
        self.sd_setImageWithURL(NSURL(string: urlString ?? ""), placeholderImage: UIImage(named: placeholderImgName))
    }
}
